package com.dou.you.che.web.controller.base;

import com.dou.you.che.core.entity.sys.SysUser;
import com.dou.you.che.web.comm.utils.shiro.ShiroUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;

/**
 * 公共组件
 * @Author 黄国刚【1058118328@qq.com】
 */
public abstract class BaseAct {

    protected Logger logger = LoggerFactory.getLogger(getClass());

    protected SysUser getUser() {
        return ShiroUtils.getUserEntity();
    }

    protected String getUserId() {
        return getUser().getUserId();
    }

    protected String getDeptId() {
        return getUser().getDeptId();
    }

    /**
     * 是否是测试模式
     */
    @Value("${spring_is_test_}")
    protected boolean isTest;
}
